package homework3;

public class Arrayset {
    public static void main(String[] args) {
        //1、声明泛型方法，可以实现任意引用类型数组指定位置元素交换。
        String[] arr = {"a","b","c","d","e"};
        method(arr,0,1);
        for (String s : arr) {
            System.out.println(s);
        }
    }
    public  static <T> void method(T[] arr,int i,int j){
        T temp = arr[i];
        arr[i] = arr[j];
        arr[j] = temp;
    }
}
